﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using log4net.Core;
using System.Reflection;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace Command
{
    public  class Log4NetFile
    {
        private ILog logger;
        public Log4NetFile()
        {
            logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("Log4Net.config"));
        }

        public void Log(string message)
        {
            logger.Warn(message);
        }
       
        public void Log(Exception ex)
        {
            logger.Warn("异常的内容:", ex);
        }
    }
}
